package com.jh.readme.iu.activity.ndetail;

import android.content.Intent;
import android.support.v7.widget.Toolbar;

import com.jh.readme.R;
import com.jh.tools.base.BaseActivity;

/**
 *  新闻详情页
 */
public class NewsDetailActivity extends BaseActivity<NewsDetailPresenter,NewsDetailModel> implements NewsDetailContract.View
{

    @Override
    public int getLayoutId() {
        return R.layout.activity_news_detail;
    }

    @Override
    public void initView() {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        Intent intent=getIntent();
        String newsId=intent.getStringExtra("newsId");
        String newsName=intent.getStringExtra("newsName");
        toolbar.setTitle(newsName);
        mPresenter.getNewsDetail(newsId);
    }

    @Override
    public void initPresenter() {
     mPresenter.setVM(this,mModel,this);
    }
}
